<template>
    <div>
        <button @click="request_get">get请求</button>
        <button @click="request_post">post请求</button>
        <button @click="request_all">all请求</button>
    </div>
</template>

<script>
export default {
    data(){
        return {

        }
    },
    methods: {
        request_get(e){
            //get
            this.$axios.get('http://rap2api.taobao.org/app/mock/944/POST/GnOrder/demand', {
                params: {
                    name: 'zyl'
                }
            }).then(res => {
                console.log(res)
            }).catch(res => {
                console.log('err')
            })
        },
        request_post(e){
            //post
            this.$axios.post('http://rap2api.taobao.org/app/mock/944/POST/GnOrder/demand', {
                name: 'zyl'
            }).then(res => {
                console.log(res)
            }).catch(res => {
                console.log('err')
            })
        },
        request_all(){
            this.$axios.all([
                this.$axios.get('http://rap2api.taobao.org/app/mock/944/POST/GnOrder/demand', {
                    params: {
                        name: '111111111'
                    }
                }),
                this.$axios.post('http://rap2api.taobao.org/app/mock/944/POST/basic/getWeekCharts', {
                    haha: '222222'
                })
            ]).then(res => {
                console.log(res)
            }).catch(res => {
                console.log('err')
            })
        }
    }
}
</script>
